//
//  UUKeeperUtility.m
//  UUCharterSupplier
//
//  Created by ZhangAo on 02/02/2018.
//  Copyright © 2018 UUCharter. All rights reserved.
//

#import "UUKeeperUtility.h"
#import <UUFoundation/UUPersistenceManager.h>
#import "UUUserManager.h"
#import "AppDelegate.h"

@implementation UUKeeperUtility

+ (NSMutableDictionary *)keeperDefaults {
    return GetPersistenceManager().userPrivateDefaults;
}

+ (NSNumber *)currentUserId {
    return GetUserManager().fetchUserInfo.userId;
}

+ (UUPermissionRoleType)currentUserRole {
    return GetUserManager().fetchUserInfo.roleId;
}

+ (void)logoutCurrentUser {
    POST_MSG_WITH_OBJ_DICT(NOTIFICATION_USER_NEED_LOGOUT, nil, @{LOGOUT_REASON_KEY:@(UULogoutReasonTypeForceLogout)});
}

@end
